3.6.6 \(\int \tan (c+d x) \sqrt {a+b \tan (c+d x)} \, dx\) [506]

Optimal. Leaf size=106 \[ -\frac {\sqrt {a-i b} \tanh ^{-1}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a-i b}}\right )}{d}-\frac {\sqrt {a+i b} \tanh ^{-1}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a+i b}}\right )}{d}+\frac {2 \sqrt {a+b \tan (c+d x)}}{d} \]

[Out]

-arctanh((a+b*tan(d*x+c))^(1/2)/(a-I*b)^(1/2))*(a-I*b)^(1/2)/d-arctanh((a+b*tan(d*x+c))^(1/2)/(a+I*b)^(1/2))*(
a+I*b)^(1/2)/d+2*(a+b*tan(d*x+c))^(1/2)/d

________________________________________________________________________________________

Rubi [A]
time = 0.12, antiderivative size = 106, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3609, 3620, 3618, 65, 214} \begin {gather*} \frac {2 \sqrt {a+b \tan (c+d x)}}{d}-\frac {\sqrt {a-i b} \tanh ^{-1}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a-i b}}\right )}{d}-\frac {\sqrt {a+i b} \tanh ^{-1}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a+i b}}\right )}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]*Sqrt[a + b*Tan[c + d*x]],x]

[Out]

-((Sqrt[a - I*b]*ArcTanh[Sqrt[a + b*Tan[c + d*x]]/Sqrt[a - I*b]])/d) - (Sqrt[a + I*b]*ArcTanh[Sqrt[a + b*Tan[c
 + d*x]]/Sqrt[a + I*b]])/d + (2*Sqrt[a + b*Tan[c + d*x]])/d

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 214

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x/Rt[-a/b, 2]], x] /; FreeQ[{a, b},
x] && NegQ[a/b]

Rule 3609

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[d*
((a + b*Tan[e + f*x])^m/(f*m)), x] + Int[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x
], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && GtQ[m, 0]

Rule 3618

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[c*(
d/f), Subst[Int[(a + (b/d)*x)^m/(d^2 + c*x), x], x, d*Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m}, x] &&
NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && EqQ[c^2 + d^2, 0]

Rule 3620

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[(c
 + I*d)/2, Int[(a + b*Tan[e + f*x])^m*(1 - I*Tan[e + f*x]), x], x] + Dist[(c - I*d)/2, Int[(a + b*Tan[e + f*x]
)^m*(1 + I*Tan[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0]
&& NeQ[c^2 + d^2, 0] &&  !IntegerQ[m]

Rubi steps

\begin {align*} \int \tan (c+d x) \sqrt {a+b \tan (c+d x)} \, dx &=\frac {2 \sqrt {a+b \tan (c+d x)}}{d}+\int \frac {-b+a \tan (c+d x)}{\sqrt {a+b \tan (c+d x)}} \, dx\\ &=\frac {2 \sqrt {a+b \tan (c+d x)}}{d}+\frac {1}{2} (-i a-b) \int \frac {1+i \tan (c+d x)}{\sqrt {a+b \tan (c+d x)}} \, dx+\frac {1}{2} (i a-b) \int \frac {1-i \tan (c+d x)}{\sqrt {a+b \tan (c+d x)}} \, dx\\ &=\frac {2 \sqrt {a+b \tan (c+d x)}}{d}+\frac {(a-i b) \text {Subst}\left (\int \frac {1}{(-1+x) \sqrt {a-i b x}} \, dx,x,i \tan (c+d x)\right )}{2 d}+\frac {(a+i b) \text {Subst}\left (\int \frac {1}{(-1+x) \sqrt {a+i b x}} \, dx,x,-i \tan (c+d x)\right )}{2 d}\\ &=\frac {2 \sqrt {a+b \tan (c+d x)}}{d}-\frac {(i a-b) \text {Subst}\left (\int \frac {1}{-1+\frac {i a}{b}-\frac {i x^2}{b}} \, dx,x,\sqrt {a+b \tan (c+d x)}\right )}{b d}+\frac {(i a+b) \text {Subst}\left (\int \frac {1}{-1-\frac {i a}{b}+\frac {i x^2}{b}} \, dx,x,\sqrt {a+b \tan (c+d x)}\right )}{b d}\\ &=-\frac {\sqrt {a-i b} \tanh ^{-1}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a-i b}}\right )}{d}-\frac {\sqrt {a+i b} \tanh ^{-1}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a+i b}}\right )}{d}+\frac {2 \sqrt {a+b \tan (c+d x)}}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.11, size = 100, normalized size = 0.94 \begin {gather*} -\frac {\sqrt {a-i b} \tanh ^{-1}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a-i b}}\right )+\sqrt {a+i b} \tanh ^{-1}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a+i b}}\right )-2 \sqrt {a+b \tan (c+d x)}}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]*Sqrt[a + b*Tan[c + d*x]],x]

[Out]

-((Sqrt[a - I*b]*ArcTanh[Sqrt[a + b*Tan[c + d*x]]/Sqrt[a - I*b]] + Sqrt[a + I*b]*ArcTanh[Sqrt[a + b*Tan[c + d*
x]]/Sqrt[a + I*b]] - 2*Sqrt[a + b*Tan[c + d*x]])/d)

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(326\) vs. \(2(88)=176\).
time = 0.12, size = 327, normalized size = 3.08

method result size
derivativedivides \(\frac {2 \sqrt {a +b \tan \left (d x +c \right )}-\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \ln \left (b \tan \left (d x +c \right )+a +\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right )}{4}+\frac {\left (a -\sqrt {a^{2}+b^{2}}\right ) \arctan \left (\frac {2 \sqrt {a +b \tan \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}+\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \ln \left (-b \tan \left (d x +c \right )-a +\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-\sqrt {a^{2}+b^{2}}\right )}{4}+\frac {\left (\sqrt {a^{2}+b^{2}}-a \right ) \arctan \left (\frac {-2 \sqrt {a +b \tan \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{d}\) \(327\)
default \(\frac {2 \sqrt {a +b \tan \left (d x +c \right )}-\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \ln \left (b \tan \left (d x +c \right )+a +\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right )}{4}+\frac {\left (a -\sqrt {a^{2}+b^{2}}\right ) \arctan \left (\frac {2 \sqrt {a +b \tan \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}+\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \ln \left (-b \tan \left (d x +c \right )-a +\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-\sqrt {a^{2}+b^{2}}\right )}{4}+\frac {\left (\sqrt {a^{2}+b^{2}}-a \right ) \arctan \left (\frac {-2 \sqrt {a +b \tan \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{d}\) \(327\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*tan(d*x+c))^(1/2)*tan(d*x+c),x,method=_RETURNVERBOSE)

[Out]

1/d*(2*(a+b*tan(d*x+c))^(1/2)-1/4*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*ln(b*tan(d*x+c)+a+(a+b*tan(d*x+c))^(1/2)*(2*(a
^2+b^2)^(1/2)+2*a)^(1/2)+(a^2+b^2)^(1/2))+(a-(a^2+b^2)^(1/2))/(2*(a^2+b^2)^(1/2)-2*a)^(1/2)*arctan((2*(a+b*tan
(d*x+c))^(1/2)+(2*(a^2+b^2)^(1/2)+2*a)^(1/2))/(2*(a^2+b^2)^(1/2)-2*a)^(1/2))+1/4*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)
*ln(-b*tan(d*x+c)-a+(a+b*tan(d*x+c))^(1/2)*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)-(a^2+b^2)^(1/2))+((a^2+b^2)^(1/2)-a)/
(2*(a^2+b^2)^(1/2)-2*a)^(1/2)*arctan((-2*(a+b*tan(d*x+c))^(1/2)+(2*(a^2+b^2)^(1/2)+2*a)^(1/2))/(2*(a^2+b^2)^(1
/2)-2*a)^(1/2)))

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(d*x+c))^(1/2)*tan(d*x+c),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(b-a>0)', see `assume?` for mor
e details)Is

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 1740 vs. \(2 (84) = 168\).
time = 1.21, size = 1740, normalized size = 16.42 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(d*x+c))^(1/2)*tan(d*x+c),x, algorithm="fricas")

[Out]

1/4*(4*sqrt(2)*d^5*sqrt(-(a*d^2*sqrt((a^2 + b^2)/d^4) - a^2 - b^2)/b^2)*sqrt(b^2/d^4)*((a^2 + b^2)/d^4)^(3/4)*
arctan(-((a^2 + b^2)*d^4*sqrt(b^2/d^4)*sqrt((a^2 + b^2)/d^4) + (a^3 + a*b^2)*d^2*sqrt(b^2/d^4) + sqrt(2)*(d^7*
sqrt(b^2/d^4)*sqrt((a^2 + b^2)/d^4) + a*d^5*sqrt(b^2/d^4))*sqrt((a*cos(d*x + c) + b*sin(d*x + c))/cos(d*x + c)
)*sqrt(-(a*d^2*sqrt((a^2 + b^2)/d^4) - a^2 - b^2)/b^2)*((a^2 + b^2)/d^4)^(3/4) - sqrt(2)*(d^7*sqrt(b^2/d^4)*sq
rt((a^2 + b^2)/d^4) + a*d^5*sqrt(b^2/d^4))*sqrt(-(a*d^2*sqrt((a^2 + b^2)/d^4) - a^2 - b^2)/b^2)*sqrt(((a^2 + b
^2)*d^2*sqrt((a^2 + b^2)/d^4)*cos(d*x + c) + sqrt(2)*(a*d^3*sqrt((a^2 + b^2)/d^4)*cos(d*x + c) + (a^2 + b^2)*d
*cos(d*x + c))*sqrt((a*cos(d*x + c) + b*sin(d*x + c))/cos(d*x + c))*sqrt(-(a*d^2*sqrt((a^2 + b^2)/d^4) - a^2 -
 b^2)/b^2)*((a^2 + b^2)/d^4)^(1/4) + (a^3 + a*b^2)*cos(d*x + c) + (a^2*b + b^3)*sin(d*x + c))/((a^2 + b^2)*cos
(d*x + c)))*((a^2 + b^2)/d^4)^(3/4))/(a^2*b^2 + b^4)) + 4*sqrt(2)*d^5*sqrt(-(a*d^2*sqrt((a^2 + b^2)/d^4) - a^2
 - b^2)/b^2)*sqrt(b^2/d^4)*((a^2 + b^2)/d^4)^(3/4)*arctan(((a^2 + b^2)*d^4*sqrt(b^2/d^4)*sqrt((a^2 + b^2)/d^4)
 + (a^3 + a*b^2)*d^2*sqrt(b^2/d^4) - sqrt(2)*(d^7*sqrt(b^2/d^4)*sqrt((a^2 + b^2)/d^4) + a*d^5*sqrt(b^2/d^4))*s
qrt((a*cos(d*x + c) + b*sin(d*x + c))/cos(d*x + c))*sqrt(-(a*d^2*sqrt((a^2 + b^2)/d^4) - a^2 - b^2)/b^2)*((a^2
 + b^2)/d^4)^(3/4) + sqrt(2)*(d^7*sqrt(b^2/d^4)*sqrt((a^2 + b^2)/d^4) + a*d^5*sqrt(b^2/d^4))*sqrt(-(a*d^2*sqrt
((a^2 + b^2)/d^4) - a^2 - b^2)/b^2)*sqrt(((a^2 + b^2)*d^2*sqrt((a^2 + b^2)/d^4)*cos(d*x + c) - sqrt(2)*(a*d^3*
sqrt((a^2 + b^2)/d^4)*cos(d*x + c) + (a^2 + b^2)*d*cos(d*x + c))*sqrt((a*cos(d*x + c) + b*sin(d*x + c))/cos(d*
x + c))*sqrt(-(a*d^2*sqrt((a^2 + b^2)/d^4) - a^2 - b^2)/b^2)*((a^2 + b^2)/d^4)^(1/4) + (a^3 + a*b^2)*cos(d*x +
 c) + (a^2*b + b^3)*sin(d*x + c))/((a^2 + b^2)*cos(d*x + c)))*((a^2 + b^2)/d^4)^(3/4))/(a^2*b^2 + b^4)) - sqrt
(2)*(a*d^3*sqrt((a^2 + b^2)/d^4) + (a^2 + b^2)*d)*sqrt(-(a*d^2*sqrt((a^2 + b^2)/d^4) - a^2 - b^2)/b^2)*((a^2 +
 b^2)/d^4)^(1/4)*log(((a^2 + b^2)*d^2*sqrt((a^2 + b^2)/d^4)*cos(d*x + c) + sqrt(2)*(a*d^3*sqrt((a^2 + b^2)/d^4
)*cos(d*x + c) + (a^2 + b^2)*d*cos(d*x + c))*sqrt((a*cos(d*x + c) + b*sin(d*x + c))/cos(d*x + c))*sqrt(-(a*d^2
*sqrt((a^2 + b^2)/d^4) - a^2 - b^2)/b^2)*((a^2 + b^2)/d^4)^(1/4) + (a^3 + a*b^2)*cos(d*x + c) + (a^2*b + b^3)*
sin(d*x + c))/((a^2 + b^2)*cos(d*x + c))) + sqrt(2)*(a*d^3*sqrt((a^2 + b^2)/d^4) + (a^2 + b^2)*d)*sqrt(-(a*d^2
*sqrt((a^2 + b^2)/d^4) - a^2 - b^2)/b^2)*((a^2 + b^2)/d^4)^(1/4)*log(((a^2 + b^2)*d^2*sqrt((a^2 + b^2)/d^4)*co
s(d*x + c) - sqrt(2)*(a*d^3*sqrt((a^2 + b^2)/d^4)*cos(d*x + c) + (a^2 + b^2)*d*cos(d*x + c))*sqrt((a*cos(d*x +
 c) + b*sin(d*x + c))/cos(d*x + c))*sqrt(-(a*d^2*sqrt((a^2 + b^2)/d^4) - a^2 - b^2)/b^2)*((a^2 + b^2)/d^4)^(1/
4) + (a^3 + a*b^2)*cos(d*x + c) + (a^2*b + b^3)*sin(d*x + c))/((a^2 + b^2)*cos(d*x + c))) + 8*(a^2 + b^2)*sqrt
((a*cos(d*x + c) + b*sin(d*x + c))/cos(d*x + c)))/((a^2 + b^2)*d)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {a + b \tan {\left (c + d x \right )}} \tan {\left (c + d x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(d*x+c))**(1/2)*tan(d*x+c),x)

[Out]

Integral(sqrt(a + b*tan(c + d*x))*tan(c + d*x), x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(d*x+c))^(1/2)*tan(d*x+c),x, algorithm="giac")

[Out]

integrate(sqrt(b*tan(d*x + c) + a)*tan(d*x + c), x)

________________________________________________________________________________________

Mupad [B]
time = 4.79, size = 290, normalized size = 2.74 \begin {gather*} \frac {2\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}}{d}-\mathrm {atan}\left (\frac {b^4\,\sqrt {\frac {a}{4\,d^2}-\frac {b\,1{}\mathrm {i}}{4\,d^2}}\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}\,32{}\mathrm {i}}{\frac {b^5\,16{}\mathrm {i}}{d}+\frac {a^2\,b^3\,16{}\mathrm {i}}{d}}+\frac {32\,a\,b^3\,\sqrt {\frac {a}{4\,d^2}-\frac {b\,1{}\mathrm {i}}{4\,d^2}}\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}}{\frac {b^5\,16{}\mathrm {i}}{d}+\frac {a^2\,b^3\,16{}\mathrm {i}}{d}}\right )\,\sqrt {\frac {a-b\,1{}\mathrm {i}}{4\,d^2}}\,2{}\mathrm {i}+\mathrm {atan}\left (\frac {b^4\,\sqrt {\frac {a}{4\,d^2}+\frac {b\,1{}\mathrm {i}}{4\,d^2}}\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}\,32{}\mathrm {i}}{\frac {b^5\,16{}\mathrm {i}}{d}+\frac {a^2\,b^3\,16{}\mathrm {i}}{d}}-\frac {32\,a\,b^3\,\sqrt {\frac {a}{4\,d^2}+\frac {b\,1{}\mathrm {i}}{4\,d^2}}\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}}{\frac {b^5\,16{}\mathrm {i}}{d}+\frac {a^2\,b^3\,16{}\mathrm {i}}{d}}\right )\,\sqrt {\frac {a+b\,1{}\mathrm {i}}{4\,d^2}}\,2{}\mathrm {i} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(c + d*x)*(a + b*tan(c + d*x))^(1/2),x)

[Out]

(2*(a + b*tan(c + d*x))^(1/2))/d - atan((b^4*(a/(4*d^2) - (b*1i)/(4*d^2))^(1/2)*(a + b*tan(c + d*x))^(1/2)*32i
)/((b^5*16i)/d + (a^2*b^3*16i)/d) + (32*a*b^3*(a/(4*d^2) - (b*1i)/(4*d^2))^(1/2)*(a + b*tan(c + d*x))^(1/2))/(
(b^5*16i)/d + (a^2*b^3*16i)/d))*((a - b*1i)/(4*d^2))^(1/2)*2i + atan((b^4*(a/(4*d^2) + (b*1i)/(4*d^2))^(1/2)*(
a + b*tan(c + d*x))^(1/2)*32i)/((b^5*16i)/d + (a^2*b^3*16i)/d) - (32*a*b^3*(a/(4*d^2) + (b*1i)/(4*d^2))^(1/2)*
(a + b*tan(c + d*x))^(1/2))/((b^5*16i)/d + (a^2*b^3*16i)/d))*((a + b*1i)/(4*d^2))^(1/2)*2i

________________________________________________________________________________________